import dayjs from 'dayjs'
import XLSX from 'xlsx';
/**
* @functionName downloadFile
* @param {类型} 参数
* @description 下载文件
* @author 蒋友为
* @date 2024-05-26 16:56:49
* @version V1.0.0
* @return
*/
export default function downloadFile(data, name) {
    // console.log(data, name);
    const link = document.createElement("a");
    const blob = new Blob([data], { type: "application/vnd.ms-excel" });
    link.style.display = "none";
    link.href = URL.createObjectURL(blob);
    link.setAttribute("download", `${name}${dayjs().format("YYYY-MM-DD-HH:mm:ss")}.xlsx`);
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
}
